#ifndef NR_CLIENT_MAINWINDOW_H
#define NR_CLIENT_MAINWINDOW_H

#include <QtGui/QMainWindow>
#include <QStandardItem>
#include <QMainwindow>
#include <QStandardItemModel>
#include "ui_nr_client_mainwindow.h"

#include <QTreeWidget>
#include "nr_client_device_tree.h"
#include "nr_client_dataAcquisition.h"
#include "nr_client_floorScada.h"
#include "nr_object_manager.h"
#include "nr_client_communication.h"

#include <QDockWidget>
#include <QTextEdit>

class mainwindow : public QMainWindow
{
	Q_OBJECT

public:
	mainwindow(QWidget *parent = 0, Qt::WFlags flags = 0);
	~mainwindow();
	//void setTreefromServer();
	void set_CommunicationToServer(client_Communication &clientdeviceTree);
/*	QWidget* get_last_mdiArea_Widget(){ return m_last_mdiArea_Widget; }*/
//	void set_DataCommunication(client_Communication &data);
	
private:
	Ui::mainwindowClass ui;
	SetTreewidget *m_treeWidget;
	nr_device_item_server n_device_item_server;
	client_Communication *m_clientdeviceTree;
	nr_object_manager &m_object_manager;

	//client_Communication *m_data;
	/*private signas:
	void rootitemdoubleclicked(QTreeWidgetItem *,int column);
	void childitemdoubleclicked(QTreeWidgetItem *,int column);
	*/
	private slots:
//		void on_TreeWidgetChildItem_Clicked(QTreeWidgetItem *item, int column);
//		void on_menubar_checkdevice_clicked();
//		void on_inputdeviceSN_okButton_clicked();
// 		void on_inputdeviceSN_cancelButton_clicked();
		void on_TreeWidget_Pressed(QTreeWidgetItem *item, int column);
		void on_TreeItemRightClicked(QTreeWidgetItem *item, int column);
		void initialize_tree(nr_device_item_server& device_item_server);
		void on_SeeDeviceData();
		void on_viewSerialServer();
		void on_device_alert_search_triggered();
		void on_TreeItemDoubleClicked(QTreeWidgetItem *item, int column);

	
		
private:
	QTreeWidgetItem* m_currentTreeWidgetItem;
	QAction* m_Act_seeData;
	QAction* m_Act_viewSerialServer;
	QMenu *m_Rmenu_1;
	QMenu *m_Rmenu_2;
	QWidget* m_last_mdiArea_Widget;
};

#endif // MAINWINDOW_H
